package reflection.test1;

public class ClassInstance {
    public static void main(String[] args) throws ClassNotFoundException {
        //1.
        Class<Test> clazz1 = Test.class;
        //2.
        Test test = new Test();
        Class<? extends Test> clazz2 = test.getClass();
        //3.
        Class<?> clazz3 = Class.forName("reflection.test1.Test");
        //4.
        ClassLoader classLoader = test.getClass().getClassLoader();
        Class<?> clazz4 = classLoader.loadClass("reflection.test1.Test");

        System.out.println(clazz1==clazz2);
        System.out.println(clazz2==clazz3);
        System.out.println(clazz3==clazz4);
    }
}


